{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<PHP>
	function get_handle($id)
	{
		
        $str = l("IPS_VIEW");
        
		$str = "<a href='".u("Ipslog/view",array("id"=>$id))."'>".$str."</a>";
		
		return $str;
	}
	function get_ips_status($status)
	{
		return l("IPS_STATUS_".$status);
	}
    function get_ips_id_type($pIdentType)
	{
		return l("IPS_IDENT_TYPE_".$pIdentType);
	}
	function get_user_type($type_id)
	{
		return l("IPS_TYPE_".$type_id);
	}
	function get_user_name_by_id($id)
    {
    	$data_info = M("ips_create_new_acct")->getById($id);

    	if($data_info["user_type"] == 0)
        {
        	
        	return M("user")->where(" id=".$data_info["user_id"])->getField("user_name");
        }
        else if($data_info["user_type"] == 1)
        {
    		return M("deal_agency")->where(" id=".$data_info["user_id"])->getField("name");;
        }
        return "";
    }
	
</php>
<load href='__TMPL__Common/js/jquery.bgiframe.js' />
<load href='__TMPL__Common/js/jquery.weebox.js' />
<load href='__TMPL__Common/style/weebox.css' />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<div class="main">
<div class="main_title">{%P_OPEN_TITLE}</div>
<div class="blank5"></div>
<form name="search" action="__APP__" method="get">	
<div class="button_row">
	
	<if condition="!$_REQUEST['referer']">
	<input type="button" class="button" value="{%EXPORT}" onclick="export_csv();" />
	</if>
</div>
<div class="blank5"></div>
<div class="search_row">

		{%P_ARG_MER_CODE}：<input type="text" class="textbox" name="argMerCode" value="{:trim($_REQUEST['argMerCode'])}" style="width:100px;" />
		{%P_MER_BILL_NO}：<input type="text" class="textbox" name="pMerBillNo" value="{:trim($_REQUEST['pMerBillNo'])}" style="width:100px;" />
        
		{%P_USER_TYPE}：<select name="user_type">
				<option value="-1" <if condition="intval($_REQUEST['user_type']) eq -1 || $_REQUEST['user_type'] eq ''">selected="selected"</if>>{%ALL}</option>
				<option value="0" <if condition="$_REQUEST['user_type'] neq '' && intval($_REQUEST['user_type']) eq 0">selected="selected"</if>>{%IPS_TYPE_0}</option>
				<option value="1" <if condition="intval($_REQUEST['user_type']) eq 1">selected="selected"</if>>{%IPS_TYPE_1}</option>		
		</select>
        
		{%P_MOBILE_NO}：<input type="text" class="textbox" name="pMobileNo" value="{:trim($_REQUEST['pMobileNo'])}" style="width:100px;" />
       
       {%P_STATUS}: 
		<select name="pStatus">
				<option value="-1" <if condition="intval($_REQUEST['pStatus']) eq -1 || $_REQUEST['pStatus'] eq ''">selected="selected"</if>>{%ALL}</option>
				<option value="10" <if condition="intval($_REQUEST['pStatus']) eq 10">selected="selected"</if>>{%IPS_STATUS_10}</option>
				<option value="5" <if condition="intval($_REQUEST['pStatus']) eq 5">selected="selected"</if>>{%IPS_STATUS_5}</option>
				<option value="9" <if condition="intval($_REQUEST['pStatus']) eq 9">selected="selected"</if>>{%IPS_STATUS_9}</option>		
		</select>
       <div class="blank5"></div>
      	{%P_SM_DATE}：
		<input type="text" class="textbox" name="start_time" id="start_time" value="{:trim($_REQUEST['start_time'])}" onfocus="return showCalendar('start_time', '%Y-%m-%d', false, false, 'start_time');" />
		-
		<input type="text" class="textbox" name="end_time" id="end_time" value="{:trim($_REQUEST['end_time'])}" onfocus="return showCalendar('end_time', '%Y-%m-%d', false, false, 'end_time');" />
		 
		
        
		<input type="hidden" value="Ipslog" name="m" />
		<input type="hidden" value="create" name="a" />
		<input type="submit" class="button" value="{%SEARCH}" />

</div>
</form>
<div class="blank5"></div>
<html:list 
	id="dataTable" 
	style="dataTable" 
	name="ips_create_new_acct" 
	action="true" 
	datasource="list" 
	show="id:{%ID}
         ,argMerCode:{%P_ARG_MER_CODE}
         ,pMerBillNo:{%P_MER_BILL_NO}
         ,id|get_user_name_by_id:{%P_USER_NAME}
         ,user_type|get_user_type:{%P_USER_TYPE}
		 ,pIdentType|get_ips_id_type:{%P_IDENT_TYPE}
		 ,pIdentNo:{%P_IDENT_NO}
		 ,pRealName:{%P_REAL_NAME}
         ,pMobileNo:{%P_MOBILE_NO}
         ,pEmail:{%P_EMAIL}
		 ,pSmDate:{%P_SM_DATE}
         ,pStatus|get_ips_status:{%P_STATUS}" 
	actionlist="id|get_handle" /> 

<div class="blank5"></div>
<div class="page">{$page}</div>
</div>
<include file="Public:footer" />